Loading...
 

Substitutes (examples)

  1. "abcdefghijklmnopqrstuvwxyz" Substitute(klm, KLM)

    results: "abcdefghijKLMnopqrstuvwxyz

  2. 23.5g substitutes(g, gram)

    results in "23.5 grams "; the object on the stack top is transformed into a string before the replace operation

  3. "abcdefghijklmnopqrstuvwxyz" "klm" "*" Substitute(STACK, STACK)

    results: "abcdefghij*nopqrstuvwxyz"; each of the two operands can be passed by stack

  4. "abcdefghijklmnopqrstuvwxyz" "klm" "" Substitute(STACK, STACK)

    results: "abcdefghijnopqrstuvwxyz";" klm" is replaced by the empty string, i.e. "klm" disappears

  5. "abcdefghijklmnopqrstuvwxyz" "" "***" Substitute(STACK, STACK)

    results: "abcdefghijklmnopqrstuvwxyz"; replace "nothing" with something: the original string remains unchanged

  6. "fair is foul and foul is fair..." Substitutes(fair, FAIR)

    results: "FAIR is foul and foul is FAIR... "; because multiple substitutions are possible